package com.edu.base.common.sms;

import java.util.Date;

public class HTTPResponse {
	private Integer status;
	private String message;
	private Object data;
	private Date date;
	
	public static HTTPResponse ok(String message) {
		return new HTTPResponse(200, message);
	}
	
	public static HTTPResponse ok(Object data) {
		return new HTTPResponse(200, data);
	}
	
	public static HTTPResponse ok(String message,Object data) {
		return new HTTPResponse(200, message, data);
	}
	
	public static HTTPResponse oks(String message, Object data, Date date) {
		return new HTTPResponse(200, message, data, date);
	}
	
	public static HTTPResponse error(Integer status, String message) {
		return new HTTPResponse(500, message, null);
	}
	
	public static HTTPResponse error(String message) {
		return new HTTPResponse(500, message, null);
	}
	
	public static HTTPResponse error(String message,Object data) {
		return new HTTPResponse(500, message, data);
	}
	
	public static HTTPResponse errors(String message,Object data) {
		return new HTTPResponse(2000, message, data);
	}
	
	
	protected HTTPResponse() {super();}
	
	private HTTPResponse(Integer status, String message) {
		this.status = status;
		this.message = message;
	}
	
	private HTTPResponse(Integer status, Object data) {
		this.status = status;
		this.data = data;
	}
	
	private HTTPResponse(Integer status, String message, Object data) {
		this.status = status;
		this.message = message;
		this.data = data;
	}
	
	private HTTPResponse(Integer status, String message, Object data, Date date) {
		this.status = status;
		this.message = message;
		this.data = data;
		this.date = date;
	}
	
	
	public Integer getStatus() {return status;}
	public String getMessage() {return message;}
	public Object getData() {return data;}
	public void setStatus(Integer status) {this.status = status;}
	public void setMessage(String message) {this.message = message;}
	public void setObject(Object data) {this.data = data;}
	public Date getDate() {return date;}
	public void setDate(Date date) {this.date = date;}
	public void setData(Object data) {this.data = data;}

	@Override
	public String toString() {
		return "HTTPResponse [status=" + status + ", message=" + message + ", data=" + data + ", date=" + date + "]";
	}
}
 
